package com.huidao.ui;

import java.util.Scanner;

import com.huidao.service.LoginService;
import com.huidao.service.RegistService;

public class BossMenu extends Menu{
	private static Scanner sc = new Scanner(System.in);
	private static final int STOP = 1;
	private static final int REGIST = 1;
	private static final int LOGIN = 2;
	private static final int BUY = 1;
	private static final int FOOD = 2;
	private static final int USER = 3;
	private static final int VIP = 4;
	private static final int ACTIVITY= 5;
	public void show(){
		//调用父类的方法
		super.show();
		System.out.println("--------------欢迎进入三千食客管理员系统------------");
		System.out.println("注册请按1，登录请按2，其他数字表示退出系统！");
		int num = sc.nextInt();
		switch (num) {
		case REGIST : {
			System.out.println("------欢迎登陆用户注册界面-----");
			System.out.println("请输入您要注册的角色：1代表普通用户，2代表收银员");
			int status = sc.nextInt();
			new RegistService().regist(status);
			this.show();
			break;
			}
		case LOGIN:{
			new LoginService().login(2);
			System.out.println("请输入您的操作：1-->点餐，2-->菜品/套餐的操作，3,-->用户操作，4-->会员操作,5-->活动操作");
			int operation = sc.nextInt();
			switch (operation) {
			case BUY:{
				while(true){
					System.out.println("停止操作请输入1");
					if (sc.nextInt() == STOP ) {
						break;
					}
				//用户登陆
				new LoginService().login(1);
				//进入用户的菜单
				new UserMenu().show();
				}
				break;
			}
			case FOOD:{
				while(true){
					System.out.println("停止操作请输入1");
					if (sc.nextInt() == STOP ) {
						break;
					}
				new FoodMenu().operation();
				}
				break;
			}
			case USER:{
				while(true){
					System.out.println("停止操作请输入1");
					if (sc.nextInt() == STOP ) {
						break;
					}
				//进入对会员的一些操作界面
				new VipCardMenu().operation();
				}
				break;
			}
			case VIP:{
				while(true){
					System.out.println("停止操作请输入1");
					if (sc.nextInt() == STOP ) {
						break;
					}
				//进入对会员的一些操作界面
				new VipCardMenu().operation();
				}
				break;
			}
			case ACTIVITY:{
				while(true){
					System.out.println("停止操作请输入1");
					if (sc.nextInt() == STOP ) {
						break;
					}
//					new 
					}
				break;
			}
			default:
				break;
			}
		    }
		default:
			break;
		}
	}
}
